<?php

include "../init.php";
include DIR_CORE."/MySQLDB.php";

session_start();

// echo "<pre>";
// print_r($_SESSION);
// print_r($_POST);
// echo "</pre>";

$pub_id = $_SESSION['userInfo']['user_id'];
$user_name = $_SESSION['userInfo']['user_name'];
$type = $_POST['type'];
$pub_content = escapeString($_POST['content']);
$pub_time = time();

if(empty($pub_content)) {
    jump("./feedBack.php", "反馈内容不能为空！");
}

$sql = "INSERT INTO feedback VALUES(null, '$user_name', '$type', '$pub_content', $pub_time, $pub_id)";
$result = my_query($sql);

if($result) {
    jump("../index.php", "反馈成功！");
} else {
    jump("./feedBack.php", "反馈失败！请稍后再试");
}

?>
